mod_rewrite .htaccess help needed urgent.

Started on the old forum in October 2012 · view the original in the archive · old links redirect here

7 replies · 594 views · started 14 years ago · 1 min read

6 participants
Mysterio Lead · 630 posts #2

I am not sure if you want this or not, but personally I use this method:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php

So, whatever you typo on the url, it will be executed on index.php Then you need to get the url from $_SESSION, explode it according to "/" and process it.

OR

RewriteEngine on
RewriteRule ^hindi/([^/\.]+)/([^/\.]+)/([^/\.]+).html?$ index.php?page=hindi&dir=$1/$2&page=$3 [L]

You won't get it working if you don't understand its logic!

mysterio.al - programming is a functional art

eminem Junior · 14 posts #3
RewriteEngine On
RewriteRule ^hindi/([^/]*)/([^/]*)\.html$ /hindi/?dir=$1&start=$2 [L]

The original URL:

http://songsvilla.tk/hindi/?dir=Mp3 Songs/Hindi Songs&start=1

The rewritten URL:

http://songsvilla.tk/hindi/Mp3 Songs/Hindi Songs/1.html
VCollinzo Junior · 24 posts #5

Hey guys pls help me check this .htaccess code, it displays Internal Server Error...

 
<IfModule mod_rewrite.c>
  RewriteEngine on
# RewriteBase physical-directory-path
 RewriteRule ^mod_rewrite.test$ mod_rewrite_test.php 
</IfModule>

Pls someone should help me out...urgent help needed pls!

just_m3. Developer · 199 posts #6

try this

RewriteRule ^hindi/([^/]+).html /index.php?dir=$1&start=1 [NC]

next time give your full damn query with file.php name !

you can use eminem's rewrite code if you want to use another start element and not one set up by default , just put index.php before question sign ? !

This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!

PranaY4U Developer · 80 posts #7

just_m3. wrote: try this

RewriteRule ^hindi/([^/]+).html /index.php?dir=$1&start=1 [NC]

next time give your full damn query with file.php name !

you can use eminem's rewrite code if you want to use another start element and not one set up by default , just put index.php before question sign ? !

Still Nt Wrkng.

arnage Lead · 811 posts #8

Its working, it just you need to add that rewrite change in all links in the script. Half way there... 🙂

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close