Forum Moderators: phranque
Please help please read this care fully.
1. my site is [domain.com...] i am decide that i should apply mode rewrite on this. after the all process. tamplating/designing etc....
(1)----Stacture of my site-1
------------------------------------------------------
these folder are exists in
Path:
www/root/js
www/root/image
www/root/css
js,images, css
------------------------------------------------------
(2)----Stacture of my site-2
------------------------------------------------------
these folder are exists in
Path:
www/root/songs/js
www/root/songs/image
www/root/songs/css
js,images, css
------------------------------------------------------
this path is "www/root/songs/index.php?cat=english" i want to use for mod_rewrite apply on this. when i apply this .htaccess file on this path then it sccessfully execute for using "Stacture of my site-2" but when i will use this "Stacture of my site-1" then our css/js/images not execute. please help me.
My .htaccess file script is:
------------------------------------------------------
RewriteEngine On
RewriteRule ^([A-Za-z0-9]+)/(.*)/(.*)$ ./$2/$3 [NC]
RewriteRule ^([A-Za-z0-9]+)[/]*$ index.php?cat=$1&sub=0 [NC]
RewriteRule ^([A-Za-z0-9]+)/([a-z]{1})_list[/]*$ index.php?cat=$1&subcat=$2&sub=1 [NC]
RewriteRule ^([A-Za-z0-9]+)/([A-Za-z0-9_-]+\.(htm¦html))$ index.php?cat=$1&mdata=$2&sub=2 [NC]
Please help me how i can solve my problem here tampleting problem with mod_rewrite.
<../images/example.jpj>
<../js/example.js>
<../css/style.css>
RewriteEngine on
#
# Skip the next four rules if the request is for resources in shared non-rewriteable subdirectories
RewriteCond ^songs/(cssŠimageŠjs)/
RewriteRule .* - [S=4]
#
RewriteRule ^([a-z0-9]+)/([^/]+)/(.*)$ ./$2/$3 [NC]
RewriteRule ^([a-z0-9]+)/?$ index.php?cat=$1&sub=0 [NC,L]
RewriteRule ^([A-Za-z0-9]+)/([A-Za-z]{1})_list/?$ index.php?cat=$1&subcat=$2&sub=1 [L]
RewriteRule ^([A-Za-z0-9]+)/([A-Za-z0-9_-]+\.html?)$ index.php?cat=$1&mdata=$2&sub=2 [L]
Because you did not include example URLs and their intended dispositions for each rule, I am not sure how your first rule was intended to affect requests, or why it was implemented this way. It appears to be intended to affect the three rules that follow it, so I did not add an [L] flag to it.
Important: Replace all broken pipe "Š" characters above with solid pipes before use; Posting on this forum modifies the pipe characters.
Jim
[1] First Rule for CSS/JS/IMAGES rewrite.... for same folder like check the path
www/rootmyfolder/songs/images/example.jpg
www/rootmyfolder/songs/js/example.js
www/rootmyfolder/songs/css/style.css
when i use these paths then my RewriteRule is successfully execute which is my rewriterule successfully execute...
-----------------------------------------------------------
RewriteEngine On
[1]RewriteRule ^([A-Za-z0-9]+)/(.*)/(.*)$ ./$2/$3 [NC]
[2]RewriteRule ^([A-Za-z0-9]+)[/]*$ index.php?cat=$1&sub=0 [NC]
[3]RewriteRule ^([A-Za-z0-9]+)/([a-z]{1})_list[/]*$ index.php?cat=$1&subcat=$2&sub=1 [NC]
[4]RewriteRule ^([A-Za-z0-9]+)/([A-Za-z0-9_-]+\.(htm¦html))$ index.php?cat=$1&mdata=$2&sub=2 [NC]
Rule[1] for rewrite css/images/js
Rule[2] for rewrite songs/catName
Rule[3] for rewrite songs/anycaracter[a-z]_list
Rule[4] for rewrite songs/catName/movename.html
this is matches.
BUT..................................................
then i will use these path
root
www/rootmyfolder/songs/images/example.jpg instead www/rootmyfolder/images/example.jpg
www/rootmyfolder/songs/js/example.js instead www/rootmyfolder/js/example.js
www/rootmyfolder/songs/css/style.css instead www/rootmyfolder/css/style.css THEN
My Above Rule Fail please help me how can i manage it with comments it's very urgent
fully toturial about mod_rewrite.