shaddf Posted June 23, 2016 Share Posted June 23, 2016 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 Name Last modified Size Description Parent 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 Quote Link to comment https://forums.phpfreaks.com/topic/301388-how-to-do-redirects-to-files-in-sub-directories/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.