Gilles Carpentier Posted June 9, 2013 Share Posted June 9, 2013 I wold like to implement URL rewriting (this is my site address : http://www.x-camsports.fr/index.php ) I was told to go into the htaccess file but what should i do ? Can you provide an example on one of my products this is a copy of the htaccess file php_flag "allow_url_fopen" "on" php_flag "allow_url_include" "on" ################################## Errors ###################################### #ErrorDocument 301 /error/301-moved_permanently.html #ErrorDocument 302 /error/302-moved_temporarily.html #ErrorDocument 303 /error/303-see_other.html #ErrorDocument 400 /error/400-bad_request.html ErrorDocument 401 /error/401-authorization_required.html #ErrorDocument 402 /error/402-payment_required.html ErrorDocument 403 /error/403-forbidden.html ErrorDocument 404 /error/404-not_found.html #ErrorDocument 405 /error/405-method_not_allowed.html #ErrorDocument 406 /error/406-not_acceptable.html #ErrorDocument 407 /error/407-proxy_authentication_required.html ErrorDocument 408 /error/408-request_timed_out.html #ErrorDocument 409 /error/409-conflicting_request.html #ErrorDocument 410 /error/410-gone.html #ErrorDocument 411 /error/411-content_length_required.html #ErrorDocument 412 /error/412-precondition_failed.html #ErrorDocument 413 /error/413-request_entity_too_long.html #ErrorDocument 414 /error/414-request_uri_too_long.html #ErrorDocument 415 /error/415-unsupported_media_type.html ErrorDocument 500 /error/500-internal_server_error.html #ErrorDocument 501 /error/501-not_implemented.html #ErrorDocument 502 /error/502-bad_gateway.html ErrorDocument 503 /error/503-service_unavailable.html #ErrorDocument 504 /error/504-gateway_timeout.html #ErrorDocument 505 /error/505-http_version_not_supported.html ################################################################################ ######################### Howto map /~user to /user ############################ RewriteEngine On RewriteCond %{REQUEST_URI} ^/([^/]+)$ RewriteCond %{DOCUMENT_ROOT}/%1 !-d RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d RewriteRule ^([^/]+)$ http://%{HTTP_HOST}/$1/ [R,L] RewriteCond %{REQUEST_URI} ^/([^/]+)/ RewriteCond %{DOCUMENT_ROOT}/%1 !-d RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d RewriteRule ^([^/]+)(.+)$ /~$1/$2 ################################################################################ ###################### Howto map /users/user to /users/user #################### RewriteEngine On RewriteCond %{REQUEST_URI} ^/users/([^/]+)$ RewriteCond %{DOCUMENT_ROOT}/%1 !-d RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d RewriteRule ^users/([^/]+)$ http://%{HTTP_HOST}/users/$1/ [R,L] RewriteCond %{REQUEST_URI} ^/users/([^/]+)/ RewriteCond %{DOCUMENT_ROOT}/%1 !-d RewriteCond /home/sites/%{SERVER_NAME}/users/%1 -d RewriteRule ^users/([^/]+)(.+)$ /~$1/$2 ################################################################################ Thanks for your help Link to comment Share on other sites More sharing options...
El Patron Posted June 9, 2013 Share Posted June 9, 2013 You would start by turning on 'friendly url's' from the back office backoffice-->preferences-->seo & url's scroll down, here is a snapshot http://screencast.com/t/dXfrHNrwQF Link to comment Share on other sites More sharing options...
Gilles Carpentier Posted June 9, 2013 Author Share Posted June 9, 2013 Sorry but when i activate Friendly URL the answer is Not Found The requested URL was not found on this server. So i have to do something before ! Somewhere may be on htaccess Help Link to comment Share on other sites More sharing options...
El Patron Posted June 9, 2013 Share Posted June 9, 2013 Sorry but when i activate Friendly URL the answer is Not Found The requested URL was not found on this server. So i have to do something before ! Somewhere may be on htaccess Help when you do as I showed, it will automatically build your .htaccess... do this, clear your browser cache and cookies after turning on friendly url. Link to comment Share on other sites More sharing options...
Gilles Carpentier Posted June 10, 2013 Author Share Posted June 10, 2013 Sorry same answer on my 1.5.3 Prestashop I have attached my htaccess file properties if it can help I am getting crazy with this - I cant understand why a so important function is so complicated to implement Please help Link to comment Share on other sites More sharing options...
El Patron Posted June 10, 2013 Share Posted June 10, 2013 Sorry same answer on my 1.5.3 Prestashop I have attached my htaccess file properties if it can help I am getting crazy with this - I cant understand why a so important function is so complicated to implement Please help It's typically very easy to implement. I suggest checking with your hosting company to see if apache module 'mod_rewrite' is installed on your site. I noticed that the .htaccess screen shot shows Feb. 2013 write date....i.e. ps did not update the .htaccess. This should have been done when you turned on friendly url's. You could try setting the permissions to 777 then turn on friendly urls, Make sure to set back to original permissions when done. Link to comment Share on other sites More sharing options...
Gilles Carpentier Posted June 10, 2013 Author Share Posted June 10, 2013 Where do you set the permissions to 777 ? Where can i check the apache module ? can you indicate an operational step by step processes please Link to comment Share on other sites More sharing options...
El Patron Posted June 10, 2013 Share Posted June 10, 2013 re 777, from the exact place you posted you screen shot from or use an ftp program...you can also ask your hosting company I suggest previously that you should contact your hosting company for mod_rewrite status Link to comment Share on other sites More sharing options...
Gilles Carpentier Posted June 10, 2013 Author Share Posted June 10, 2013 when i put canonique to No then to yes this screen appear is it here that i should update anything ? if yes can give an example Link to comment Share on other sites More sharing options...
Gilles Carpentier Posted June 10, 2013 Author Share Posted June 10, 2013 Another point : it seems that prestahop 1.5.3.1 is well known to bug for url rewirting so what is the solution . Is it to update to 1.5.4. Will i loose my shop ? How should i proceed if i decide to update prestashop ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now