Jump to content

URL rewriting


Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...