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



  • Join us on the largest Reefing community in Asia!

    Sign up and share your reefing journey with us, make friends and get helps from the community .

     

  • Topics

  • Latest Update

    1. 0

      LEGITIMATE CRYPTOCURRENCY RECOVERY SERVICES / HIRE ULTIMATE HACKER JERRY

    2. 0

      Cryptocurrency Tracing For Crypto Scam Recovery / Captain WebGenesis

    3. 0

      THE BEST ASSET TRACKING SOLUTIONS / MUYERN TRUST HACKER

    4. 0

      مصنع حبوب الاجهاض للبيع في جدة 00966563940846 التوصيل السريع

    5. 0

      حبوب اجهاض (سايتوتك) للبيع في الرياض 00966563940846 احذروا التحويل - الدفع كاش

×
×
  • Create New...