2014-10-03 2 views
0

Я хочу изменить следующий динамический URL в URL SEF: http://sampleurl.com/en/movie-details.php?id=1001Почему мой код файла .htaccess не работает

URL: URL должен быть как следующее: http://sampleurl.com/movie/id-1001/

Пожалуйста, помогите мне ... .. вот мой код ... Я использую GoDaddy сервер

Options -MultiViews 
## Mod_rewrite in use. 
RewriteEngine On 

# Block out any script trying to base64_encode data within the URL. 
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] 

# Block out any script that includes a <script> tag in URL. 
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR] 

# Block out any script trying to set a PHP GLOBALS variable via URL. 
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] 

# Block out any script trying to modify a _REQUEST variable via URL. 
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 

# Return 403 Forbidden header and show the content of the root homepage 

RewriteRule .* movie-details.php [F] 

#RewriteBase/

RewriteCond %{REQUEST_URI} !^/movie-details\.php 

RewriteRule .* /en/movie-details.php?id=$1 [L] 


    # Removes index.php from URLs 
    RewriteCond %{THE_REQUEST} ^GET.*movie-details\.php [NC] 
    RewriteCond %{REQUEST_URI} !/en/.* [NC] 
    RewriteRule (.*?)movie-details\.php/*(.*) /$1$2 [R=301,NE,L] 

    # Directs all EE web requests through the site index file 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ /movie-details.php/$1 [L] 

ответ

1
RewriteEngine on 
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f 
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d 

RewriteRule ^movie/id-([0-9]+)/$ /movie-details.php?id=$1 [QSA,L] 
Смежные вопросы