Jump to content

URL Redirection


Wairds

Recommended Posts

Could somebody advise why the following code, place in the .htaccess file, is not executing?

RewriteEngine on
rewriterule ^viewcategory.php?groupid=29(.*)$ http://www.testcovers.co.uk/test/toiletry-and-make-up-bags.html$1 [r,nc]

It does not seem to recognise - ^viewcategory.php?groupid=29(.*)$

The website is operating on an Apache server.

Any suggestions gratefully received!

Link to comment
Share on other sites

Not being an expert in ReWrite Rules, I am concerned about the fact that you expect viewcategory to be at the start of the string. There may be something else at the start of the string. Also, a period in a pattern is any character, including a period. A questionmark also has special meaning.

I would try:

ReWriteRule ^(.*)viewcategory\.php\?groupid=29(.*)$ your_new_link$2 [R,NC]

This catches whatever may be in front, such as a leading slash, looks for an actual period, and looks for an actual questionmark.

The next concern of mine is the folder /test/ in the destination URL. Is /test/ a name of a category, that is, an actual part of the category's seo_path, or is this where you have installed CubeCart? If the latter, then you may need a ReWriteBase directive.

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...