Jump to content

how to do redirects to files in sub directories


shaddf

Recommended Posts

I have such a directory structure:

httpdocs/    .htaccess    index.phpmain/     splash.php     home.php    app/        app.php
    images/        hello.png            images1/        hello2.png    js/        jquery.js    css/        style.css

how can i do urlrewriting to all files in sub folders,so that my app can be seo friendly.I have tried this:

<IfModule mod_rewrite.c>
# Enable mod_rewrite
RewriteEngine On
# Specify the folder in which the application resides.
# Use / if the application is in the root.
RewriteBase /httpdocs
# Rewrite to correct domain to avoid canonicalization problems
# RewriteCond %{HTTP_HOST} !^www\.yyy\.com
# RewriteRule ^(.*)$ http://www.yyy.com/$1 [R=301,L]
# Rewrite URLs ending in /index.php or /index.html to /
RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php|html?)\ HTTP
RewriteRule ^(.*)index\.(php|html?)$ $1 [R=301,L]
# Rewrite category pages
RewriteRule ^.*-d([0-9]+)/.*-c([0-9]+)/page-([0-9]+)/?$ home.php?Depart
mentId=$1&CategoryId=$2&Page=$3 [L]
RewriteRule ^.*-d([0-9]+)/.*-c([0-9]+)/?$ home.php?DepartmentId=$1&Cate
goryId=$2 [L]

But it returns me to the: localhost

Index of /httpdocs/main blank.gifName Last modified Size Description back.gifParent Directory   -  

what can I do to clear this??

note relative links to home.php are in splash.php which take me to home.php -the activity page

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.