Jump to content

How I fixed .htaccess to make SEO friendly URLs work for me


Guest johnDuly

Recommended Posts

Guest johnDuly

I am using ver CC 5.08.

and have not been able to get past the 404 error when turning on SEO URLs using the providing .htaccess.

so I reviewed the mod rewrite docs and decided to try my own fixes.

What I ended up with adding "%1" to the last rewrite rule:

RewriteRule ^(.*).html?$ %1/index.php?seo_path=$1 [L,QSA]

this fixed my 404 errors when using SEO friendly URLs.

I hope this helps someone else.

--john

update:

I guess I should have added my store is accessed like this

store.domain.com

and the above fix made that work,

but then I found sometimes request were reverting back to what "store.domain.com" points to

domain.com/store (which didn't work with the stock rewrite either for some reason )

to get both forms of the url to work this is what I ended up doing

note: I had to hard code the "store" perhaps someone with more .htaccess knowledge could improve

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} !=/favicon.ico

RewriteCond %{HTTP_HOST} ^
store

RewriteRule ^(.*).html?$ %1/index.php?seo_path=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} !=/favicon.ico

RewriteRule ^(.*).html?$ %1/
store
/index.php?seo_path=$1 [L,QSA]

I couldn't figure out how to get either to work with out hardcoding the "store".

I hope this helps some of those who are having problems.

--john

Edited by johnDuly
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...