Jump to content

Anyone familiar with Apache server


Hon
 Share

Recommended Posts

  • SRC Member

Help me!!! I need help on mod rewrite in .htaccess file.

Currently, I have a hundreds of shtml file sitting in www.domain.com/abc/ and its sub-sub directories. The contents were copied over to www.domain.com/xyz/ now but some of the 3rd or 4th level directory structure have been change.

I need to add in a mod rewrite in the .htaccess file to redirect users accessing the old site to the new site of the same page they requesting on the old. But if the new site does not host the old site pages anymore, it should move up 1 directory level and look for index.shtml.

Anyone can help me??

Link to comment
Share on other sites

  • SRC Member

cks,

Thanks for replying... its not htpasswd concern. I'm looking in mod rewrite, its for URL rewriting and manipulation.

Its looks something like this,

RewriteRule ^(.*)$ http://www.example.com/xyz/$1 [R=301,L]

RewriteCond %{REQUEST_URI} !^/index\.shtml$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule \.shtml$ http://www.example.com/xyz/index.shtml [R=301,L]

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.

 Share



×
×
  • Create New...